package com.whlilong.jxc.editor.support;

import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;

import com.whlilong.jxc.listener.IEditorListener;
import com.whlilong.jxc.listener.IModifyListener;

public class PurcharsBookTextKeyCellEditor extends TextCellEditor {
	protected IEditorListener listener;
	private int currentColumn;
	private String oldString;//初始化值
	private IModifyListener modify;
	
	public PurcharsBookTextKeyCellEditor(Composite parent,
			IEditorListener listener, int column,
			IModifyListener modify) {
		super(parent, SWT.SINGLE);
		this.listener = listener;
		this.currentColumn = column;
		this.modify = modify;
	}
	public void releaseKey() {
		fireApplyEditorValue();
		deactivate();
	}
	
	@Override
	protected void fireApplyEditorValue() {
		super.fireApplyEditorValue();
		this.modify.modify();
	}

}
